home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / BLPUTGET.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  1.8 KB  |  123 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // BlazeClass
  8. //
  9.  
  10. #ifndef __BCPLUSPLUS__
  11. #pragma inline
  12. #endif
  13.  
  14. #include "fli.h"
  15.  
  16. #ifdef __BCPLUSPLUS__
  17. #pragma hdrstop
  18. #endif
  19.  
  20. #define I asm
  21.  
  22. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  23. //
  24. // PutArea()
  25. //
  26. // Puts a saved area on the display
  27. //
  28. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  29.  
  30. void BlazeClass::PutArea(int X,int Y,void far *S)
  31. {
  32.   int ScreenWidth = BlazeClass::QuickWidth;
  33.  
  34.   void far *OUTPUT=BlazeClass::OUTPUT;
  35.   I les di,OUTPUT
  36.  
  37.   _DI += ((Y*ScreenWidth)+(X*2));
  38.  
  39.   I push ds
  40.  
  41.   I lds si,S
  42.  
  43.   I mov bx,word ptr ds:[si]
  44.   I mov dx,word ptr ds:[si+2]
  45.  
  46.   I add si,4
  47.  
  48.   I cld
  49.  
  50. looped:
  51.  
  52.   I push di
  53.   I mov cx,bx
  54.  
  55.   I rep movsw
  56.  
  57.   I pop di
  58.   I add di,ScreenWidth
  59.   I dec dx
  60.   I or dx,dx
  61.   I jne looped
  62.  
  63.   I pop ds
  64. }
  65.  
  66. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  67. //
  68. // GetArea()
  69. //
  70. // Gets an area from the display
  71. //
  72. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  73.  
  74. void BlazeClass::GetArea(int X,int Y,int Width,int Height,void far *S)
  75. {
  76.   if (Width<1 || Height<1)
  77.     return;
  78.  
  79.   int ScreenWidth = BlazeClass::QuickWidth;
  80.  
  81.   void far *OUTPUT=BlazeClass::OUTPUT;
  82.  
  83.   I mov bx,[Width]
  84.   I mov dx,[Height]
  85.  
  86.   I push ds
  87.  
  88.   I push dx
  89.   I push bx
  90.  
  91.   I les di,S
  92.  
  93.   I lds si,OUTPUT
  94.  
  95.   _SI += ((Y*ScreenWidth)+(X*2));
  96.  
  97.   I pop bx
  98.   I pop dx
  99.  
  100.   I mov word ptr es:[di],bx
  101.   I mov word ptr es:[di+2],dx
  102.  
  103.   I add di,4
  104.  
  105.   I cld
  106.  
  107. looped:
  108.  
  109.   I push si
  110.   I mov cx,bx
  111.  
  112.   I rep movsw
  113.  
  114.   I pop si
  115.   I add si,ScreenWidth
  116.   I dec dx
  117.   I or dx,dx
  118.   I jne looped
  119.  
  120.   I pop ds
  121. }
  122.  
  123.